var str = "fjskfjsl fjkdsjfkls fjklsfjlsd127.0.0.1fjksldfjafjio jfk192.168.1.101sljfs fsdjfkldsfjsklfsklffjoijfoiaf  asfjs fed jfjf jf sdjfsi jfi jafis function  dd ( ) { }afjsdiajf iosa function abc(){} jfisjad fjsaiofjaoissf addedfds";
var res1 = /\d{1,3}[.]\d{1,3}[.]\d{1,3}[.]\d{1,3}/g;
var res2 = /([f](?=unction))[a-z]{7}\s+\D{1}\w*\s*[(]\s*[)]\s*[{]\s*[}]/gi;




console.log(str.match(res1));
console.log(str.match(res2));

//console.log(str.search(res1));
// var result = res1.exec(str);
// console.log(result);
// result = res1.exec(str);
// console.log(result);
